package com.easytool.modules.front.controller;

import com.easytool.modules.front.service.ImgTextService;
import com.easytool.utils.UploadUtil;
import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.json.FastJson;
import com.jfinal.upload.UploadFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 图片文字识别
 *
 * @author liupengtao
 * @date 2019/12/18
 */
public class ImgTextController extends Controller {

    @Inject
    ImgTextService imgTextService;

    public void index(){
        render("img_text.html");
    }


    /**
     * 通用文字识别
     */
    public void basicGeneral(){
        UploadFile file = getFile("file", UploadUtil.tempPath);
        List<Object> result = imgTextService.basicGeneral(file);
        renderJson(result);
    }


}
